﻿using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApp1
{
    public class LinearArray
    {
        public void Linear()
        {
            int[] arr = new int[5];
            Console.WriteLine("请输入5个整数：");
            for (int i = 0; i < arr.Length; i++)
            {
                arr[i] = int.Parse(Console.ReadLine());
            }
            int max = arr[0];
            for (int i = 1; i < arr.Length; i++)
            {
                if (arr[i] > max)
                {
                    max = arr[i];
                }
            }
            Console.WriteLine("这5个数中最大的是{0}", max);

        }
    }

}

